import React,{useState} from 'react'
import './Add.css';

//添加作者页面
const Addauthor = () => {
    const arr = ['作者id: ','作者姓名: '];
    const [author,setAuthor] = useState({});
    return (
        <div className="board">
            <div className="info">
                <h3>新增列表</h3>
                <form action = "https://api.luffe.club:3001/adminauthor" method = "post" enctype="multipart/form-data">
                <div className="addList">
                    <ul>
                        {
                            arr.map((item,index)=>{
                                return(
                                    <li style={{width:250}}>
                                        <span>{item}</span>
                                        <input name={item} value={author[item]} onChange={(e)=>setAuthor({...author,[item]:e.target.value})}></input>
                                    </li>
                                )
                            })
                        }
                    </ul>
                    <li id="content" style={{listStyle:'none'}}>
                        <span>作者信息：</span>
                        <textarea name='作者信息: ' onChange={(e)=>setAuthor({...author,'作者信息: ':e.target.value})}></textarea>
                        <input type="submit" value="提交"/>
                    </li>
                </div>
                </form>
            </div>
        </div>
    )
}
export default Addauthor